
// Copyright (C) 2009-2011 Luca Piccioni
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;

#pragma warning disable 1572, 1573

namespace Derm.OpenGL {

	/// <summary>
	/// Implementation of the OpenGL specification 
	/// </summary>
	public unsafe partial class Wgl : ProcLoader
	{

		/// <summary>
		/// Binding for wglAssociateImageBufferEventsI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="pEvent">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="pAddress">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="pSize">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		/// <param name="count">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static Boolean AssociateImageBufferEventsI3D(IntPtr hDC, IntPtr[] pEvent, IntPtr[] pAddress, Int32[] pSize, UInt32 count) {
			Boolean retvalue;
			unsafe {
				fixed (IntPtr* fp_pEvent = pEvent)
				fixed (IntPtr* fp_pAddress = pAddress)
				fixed (Int32* fp_pSize = pSize)
				{
					if      (Delegates.pwglAssociateImageBufferEventsI3D != null)
						retvalue = (Delegates.pwglAssociateImageBufferEventsI3D(hDC, fp_pEvent, fp_pAddress, fp_pSize, count));
					else
						throw new InvalidOperationException("binding point AssociateImageBufferEventsI3D cannot be found");
				}
			}
			LogProc("wglAssociateImageBufferEventsI3D({0}, {1}, {2}, {3}, {4}) = {5}", hDC, pEvent, pAddress, pSize, count, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglBeginFrameTrackingI3D function.
		/// </summary>
		public static Boolean BeginFrameTrackingI3D() {
			Boolean retvalue;
			if      (Delegates.pwglBeginFrameTrackingI3D != null)
				retvalue = (Delegates.pwglBeginFrameTrackingI3D());
			else
				throw new InvalidOperationException("binding point BeginFrameTrackingI3D cannot be found");
			LogProc("wglBeginFrameTrackingI3D()");
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglCreateImageBufferI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="dwSize">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="uFlags">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static IntPtr CreateImageBufferI3D(IntPtr hDC, Int32 dwSize, UInt32 uFlags) {
			IntPtr retvalue;
			if      (Delegates.pwglCreateImageBufferI3D != null)
				retvalue = (Delegates.pwglCreateImageBufferI3D(hDC, dwSize, uFlags));
			else
				throw new InvalidOperationException("binding point CreateImageBufferI3D cannot be found");
			LogProc("wglCreateImageBufferI3D({0}, {1}, {2}) = {3}", hDC, dwSize, uFlags, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglDestroyImageBufferI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="pAddress">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean DestroyImageBufferI3D(IntPtr hDC, IntPtr pAddress) {
			Boolean retvalue;
			if      (Delegates.pwglDestroyImageBufferI3D != null)
				retvalue = (Delegates.pwglDestroyImageBufferI3D(hDC, pAddress));
			else
				throw new InvalidOperationException("binding point DestroyImageBufferI3D cannot be found");
			LogProc("wglDestroyImageBufferI3D({0}, {1}) = {2}", hDC, pAddress, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglDisableFrameLockI3D function.
		/// </summary>
		public static Boolean DisableFrameLockI3D() {
			Boolean retvalue;
			if      (Delegates.pwglDisableFrameLockI3D != null)
				retvalue = (Delegates.pwglDisableFrameLockI3D());
			else
				throw new InvalidOperationException("binding point DisableFrameLockI3D cannot be found");
			LogProc("wglDisableFrameLockI3D()");
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglDisableGenlockI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean DisableGenlockI3D(IntPtr hDC) {
			Boolean retvalue;
			if      (Delegates.pwglDisableGenlockI3D != null)
				retvalue = (Delegates.pwglDisableGenlockI3D(hDC));
			else
				throw new InvalidOperationException("binding point DisableGenlockI3D cannot be found");
			LogProc("wglDisableGenlockI3D({0}) = {1}", hDC, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglEnableFrameLockI3D function.
		/// </summary>
		public static Boolean EnableFrameLockI3D() {
			Boolean retvalue;
			if      (Delegates.pwglEnableFrameLockI3D != null)
				retvalue = (Delegates.pwglEnableFrameLockI3D());
			else
				throw new InvalidOperationException("binding point EnableFrameLockI3D cannot be found");
			LogProc("wglEnableFrameLockI3D()");
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglEnableGenlockI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static Boolean EnableGenlockI3D(IntPtr hDC) {
			Boolean retvalue;
			if      (Delegates.pwglEnableGenlockI3D != null)
				retvalue = (Delegates.pwglEnableGenlockI3D(hDC));
			else
				throw new InvalidOperationException("binding point EnableGenlockI3D cannot be found");
			LogProc("wglEnableGenlockI3D({0}) = {1}", hDC, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglEndFrameTrackingI3D function.
		/// </summary>
		public static Boolean EndFrameTrackingI3D() {
			Boolean retvalue;
			if      (Delegates.pwglEndFrameTrackingI3D != null)
				retvalue = (Delegates.pwglEndFrameTrackingI3D());
			else
				throw new InvalidOperationException("binding point EndFrameTrackingI3D cannot be found");
			LogProc("wglEndFrameTrackingI3D()");
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGenlockSampleRateI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="uRate">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static Boolean GenlockSampleRateI3D(IntPtr hDC, UInt32 uRate) {
			Boolean retvalue;
			if      (Delegates.pwglGenlockSampleRateI3D != null)
				retvalue = (Delegates.pwglGenlockSampleRateI3D(hDC, uRate));
			else
				throw new InvalidOperationException("binding point GenlockSampleRateI3D cannot be found");
			LogProc("wglGenlockSampleRateI3D({0}, {1}) = {2}", hDC, uRate, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGenlockSourceDelayI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="uDelay">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static Boolean GenlockSourceDelayI3D(IntPtr hDC, UInt32 uDelay) {
			Boolean retvalue;
			if      (Delegates.pwglGenlockSourceDelayI3D != null)
				retvalue = (Delegates.pwglGenlockSourceDelayI3D(hDC, uDelay));
			else
				throw new InvalidOperationException("binding point GenlockSourceDelayI3D cannot be found");
			LogProc("wglGenlockSourceDelayI3D({0}, {1}) = {2}", hDC, uDelay, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGenlockSourceEdgeI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="uEdge">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static Boolean GenlockSourceEdgeI3D(IntPtr hDC, UInt32 uEdge) {
			Boolean retvalue;
			if      (Delegates.pwglGenlockSourceEdgeI3D != null)
				retvalue = (Delegates.pwglGenlockSourceEdgeI3D(hDC, uEdge));
			else
				throw new InvalidOperationException("binding point GenlockSourceEdgeI3D cannot be found");
			LogProc("wglGenlockSourceEdgeI3D({0}, {1}) = {2}", hDC, uEdge, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGenlockSourceI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="uSource">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static Boolean GenlockSourceI3D(IntPtr hDC, UInt32 uSource) {
			Boolean retvalue;
			if      (Delegates.pwglGenlockSourceI3D != null)
				retvalue = (Delegates.pwglGenlockSourceI3D(hDC, uSource));
			else
				throw new InvalidOperationException("binding point GenlockSourceI3D cannot be found");
			LogProc("wglGenlockSourceI3D({0}, {1}) = {2}", hDC, uSource, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetDigitalVideoParametersI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iAttribute">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="piValue">
		/// A <see cref="T:System.Int32*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetDigitalVideoParametersI3D(IntPtr hDC, int iAttribute, [Out] int[] piValue) {
			Boolean retvalue;
			unsafe {
				fixed (int* fp_piValue = piValue)
				{
					if      (Delegates.pwglGetDigitalVideoParametersI3D != null)
						retvalue = (Delegates.pwglGetDigitalVideoParametersI3D(hDC, iAttribute, fp_piValue));
					else
						throw new InvalidOperationException("binding point GetDigitalVideoParametersI3D cannot be found");
				}
			}
			LogProc("wglGetDigitalVideoParametersI3D({0}, {1}, {2}) = {3}", hDC, iAttribute, piValue, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetFrameUsageI3D function.
		/// </summary>
		/// <param name="pUsage">
		/// A <see cref="T:System.Single"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetFrameUsageI3D([Out] out float pUsage) {
			Boolean retvalue;
			unsafe {
				fixed (float* fp_pUsage = &pUsage)
				{
					if      (Delegates.pwglGetFrameUsageI3D != null)
						retvalue = (Delegates.pwglGetFrameUsageI3D(fp_pUsage));
					else
						throw new InvalidOperationException("binding point GetFrameUsageI3D cannot be found");
				}
			}
			LogProc("wglGetFrameUsageI3D({0}) = {1}", pUsage, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetGammaTableI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iEntries">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="puRed">
		/// A <see cref="T:System.UInt16*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="puGreen">
		/// A <see cref="T:System.UInt16*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="puBlue">
		/// A <see cref="T:System.UInt16*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetGammaTableI3D(IntPtr hDC, int iEntries, [Out] UInt16[] puRed, [Out] UInt16[] puGreen, [Out] UInt16[] puBlue) {
			Boolean retvalue;
			unsafe {
				fixed (UInt16* fp_puRed = puRed)
				fixed (UInt16* fp_puGreen = puGreen)
				fixed (UInt16* fp_puBlue = puBlue)
				{
					if      (Delegates.pwglGetGammaTableI3D != null)
						retvalue = (Delegates.pwglGetGammaTableI3D(hDC, iEntries, fp_puRed, fp_puGreen, fp_puBlue));
					else
						throw new InvalidOperationException("binding point GetGammaTableI3D cannot be found");
				}
			}
			LogProc("wglGetGammaTableI3D({0}, {1}, {2}, {3}, {4}) = {5}", hDC, iEntries, puRed, puGreen, puBlue, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetGammaTableParametersI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iAttribute">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="piValue">
		/// A <see cref="T:System.Int32*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetGammaTableParametersI3D(IntPtr hDC, int iAttribute, [Out] int[] piValue) {
			Boolean retvalue;
			unsafe {
				fixed (int* fp_piValue = piValue)
				{
					if      (Delegates.pwglGetGammaTableParametersI3D != null)
						retvalue = (Delegates.pwglGetGammaTableParametersI3D(hDC, iAttribute, fp_piValue));
					else
						throw new InvalidOperationException("binding point GetGammaTableParametersI3D cannot be found");
				}
			}
			LogProc("wglGetGammaTableParametersI3D({0}, {1}, {2}) = {3}", hDC, iAttribute, piValue, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetGenlockSampleRateI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="uRate">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetGenlockSampleRateI3D(IntPtr hDC, [Out] out UInt32 uRate) {
			Boolean retvalue;
			unsafe {
				fixed (UInt32* fp_uRate = &uRate)
				{
					if      (Delegates.pwglGetGenlockSampleRateI3D != null)
						retvalue = (Delegates.pwglGetGenlockSampleRateI3D(hDC, fp_uRate));
					else
						throw new InvalidOperationException("binding point GetGenlockSampleRateI3D cannot be found");
				}
			}
			LogProc("wglGetGenlockSampleRateI3D({0}, {1}) = {2}", hDC, uRate, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetGenlockSourceDelayI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="uDelay">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetGenlockSourceDelayI3D(IntPtr hDC, [Out] out UInt32 uDelay) {
			Boolean retvalue;
			unsafe {
				fixed (UInt32* fp_uDelay = &uDelay)
				{
					if      (Delegates.pwglGetGenlockSourceDelayI3D != null)
						retvalue = (Delegates.pwglGetGenlockSourceDelayI3D(hDC, fp_uDelay));
					else
						throw new InvalidOperationException("binding point GetGenlockSourceDelayI3D cannot be found");
				}
			}
			LogProc("wglGetGenlockSourceDelayI3D({0}, {1}) = {2}", hDC, uDelay, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetGenlockSourceEdgeI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="uEdge">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetGenlockSourceEdgeI3D(IntPtr hDC, [Out] out UInt32 uEdge) {
			Boolean retvalue;
			unsafe {
				fixed (UInt32* fp_uEdge = &uEdge)
				{
					if      (Delegates.pwglGetGenlockSourceEdgeI3D != null)
						retvalue = (Delegates.pwglGetGenlockSourceEdgeI3D(hDC, fp_uEdge));
					else
						throw new InvalidOperationException("binding point GetGenlockSourceEdgeI3D cannot be found");
				}
			}
			LogProc("wglGetGenlockSourceEdgeI3D({0}, {1}) = {2}", hDC, uEdge, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetGenlockSourceI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="uSource">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetGenlockSourceI3D(IntPtr hDC, [Out] out UInt32 uSource) {
			Boolean retvalue;
			unsafe {
				fixed (UInt32* fp_uSource = &uSource)
				{
					if      (Delegates.pwglGetGenlockSourceI3D != null)
						retvalue = (Delegates.pwglGetGenlockSourceI3D(hDC, fp_uSource));
					else
						throw new InvalidOperationException("binding point GetGenlockSourceI3D cannot be found");
				}
			}
			LogProc("wglGetGenlockSourceI3D({0}, {1}) = {2}", hDC, uSource, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetMscRateOML function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="numerator">
		/// A <see cref="T:System.Int32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="denominator">
		/// A <see cref="T:System.Int32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetMscRateOML(IntPtr hdc, [Out] out Int32 numerator, [Out] out Int32 denominator) {
			Boolean retvalue;
			unsafe {
				fixed (Int32* fp_numerator = &numerator)
				fixed (Int32* fp_denominator = &denominator)
				{
					if      (Delegates.pwglGetMscRateOML != null)
						retvalue = (Delegates.pwglGetMscRateOML(hdc, fp_numerator, fp_denominator));
					else
						throw new InvalidOperationException("binding point GetMscRateOML cannot be found");
				}
			}
			LogProc("wglGetMscRateOML({0}, {1}, {2}) = {3}", hdc, numerator, denominator, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglGetSyncValuesOML function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="ust">
		/// A <see cref="T:System.Int64"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="msc">
		/// A <see cref="T:System.Int64"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="sbc">
		/// A <see cref="T:System.Int64"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean GetSyncValuesOML(IntPtr hdc, [Out] out Int64 ust, [Out] out Int64 msc, [Out] out Int64 sbc) {
			Boolean retvalue;
			unsafe {
				fixed (Int64* fp_ust = &ust)
				fixed (Int64* fp_msc = &msc)
				fixed (Int64* fp_sbc = &sbc)
				{
					if      (Delegates.pwglGetSyncValuesOML != null)
						retvalue = (Delegates.pwglGetSyncValuesOML(hdc, fp_ust, fp_msc, fp_sbc));
					else
						throw new InvalidOperationException("binding point GetSyncValuesOML cannot be found");
				}
			}
			LogProc("wglGetSyncValuesOML({0}, {1}, {2}, {3}) = {4}", hdc, ust, msc, sbc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglIsEnabledFrameLockI3D function.
		/// </summary>
		/// <param name="pFlag">
		/// A <see cref="T:System.Boolean"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean IsEnabledFrameLockI3D([Out] out Boolean pFlag) {
			Boolean retvalue;
			unsafe {
				fixed (Boolean* fp_pFlag = &pFlag)
				{
					if      (Delegates.pwglIsEnabledFrameLockI3D != null)
						retvalue = (Delegates.pwglIsEnabledFrameLockI3D(fp_pFlag));
					else
						throw new InvalidOperationException("binding point IsEnabledFrameLockI3D cannot be found");
				}
			}
			LogProc("wglIsEnabledFrameLockI3D({0}) = {1}", pFlag, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglIsEnabledGenlockI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="pFlag">
		/// A <see cref="T:System.Boolean"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean IsEnabledGenlockI3D(IntPtr hDC, [Out] out Boolean pFlag) {
			Boolean retvalue;
			unsafe {
				fixed (Boolean* fp_pFlag = &pFlag)
				{
					if      (Delegates.pwglIsEnabledGenlockI3D != null)
						retvalue = (Delegates.pwglIsEnabledGenlockI3D(hDC, fp_pFlag));
					else
						throw new InvalidOperationException("binding point IsEnabledGenlockI3D cannot be found");
				}
			}
			LogProc("wglIsEnabledGenlockI3D({0}, {1}) = {2}", hDC, pFlag, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglQueryFrameLockMasterI3D function.
		/// </summary>
		/// <param name="pFlag">
		/// A <see cref="T:System.Boolean"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean QueryFrameLockMasterI3D([Out] out Boolean pFlag) {
			Boolean retvalue;
			unsafe {
				fixed (Boolean* fp_pFlag = &pFlag)
				{
					if      (Delegates.pwglQueryFrameLockMasterI3D != null)
						retvalue = (Delegates.pwglQueryFrameLockMasterI3D(fp_pFlag));
					else
						throw new InvalidOperationException("binding point QueryFrameLockMasterI3D cannot be found");
				}
			}
			LogProc("wglQueryFrameLockMasterI3D({0}) = {1}", pFlag, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglQueryFrameTrackingI3D function.
		/// </summary>
		/// <param name="pFrameCount">
		/// A <see cref="T:System.Int32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="pMissedFrames">
		/// A <see cref="T:System.Int32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="pLastMissedUsage">
		/// A <see cref="T:System.Single"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean QueryFrameTrackingI3D([Out] out Int32 pFrameCount, [Out] out Int32 pMissedFrames, [Out] out float pLastMissedUsage) {
			Boolean retvalue;
			unsafe {
				fixed (Int32* fp_pFrameCount = &pFrameCount)
				fixed (Int32* fp_pMissedFrames = &pMissedFrames)
				fixed (float* fp_pLastMissedUsage = &pLastMissedUsage)
				{
					if      (Delegates.pwglQueryFrameTrackingI3D != null)
						retvalue = (Delegates.pwglQueryFrameTrackingI3D(fp_pFrameCount, fp_pMissedFrames, fp_pLastMissedUsage));
					else
						throw new InvalidOperationException("binding point QueryFrameTrackingI3D cannot be found");
				}
			}
			LogProc("wglQueryFrameTrackingI3D({0}, {1}, {2}) = {3}", pFrameCount, pMissedFrames, pLastMissedUsage, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglQueryGenlockMaxSourceDelayI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="uMaxLineDelay">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="uMaxPixelDelay">
		/// A <see cref="T:System.UInt32"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean QueryGenlockMaxSourceDelayI3D(IntPtr hDC, [Out] out UInt32 uMaxLineDelay, [Out] out UInt32 uMaxPixelDelay) {
			Boolean retvalue;
			unsafe {
				fixed (UInt32* fp_uMaxLineDelay = &uMaxLineDelay)
				fixed (UInt32* fp_uMaxPixelDelay = &uMaxPixelDelay)
				{
					if      (Delegates.pwglQueryGenlockMaxSourceDelayI3D != null)
						retvalue = (Delegates.pwglQueryGenlockMaxSourceDelayI3D(hDC, fp_uMaxLineDelay, fp_uMaxPixelDelay));
					else
						throw new InvalidOperationException("binding point QueryGenlockMaxSourceDelayI3D cannot be found");
				}
			}
			LogProc("wglQueryGenlockMaxSourceDelayI3D({0}, {1}, {2}) = {3}", hDC, uMaxLineDelay, uMaxPixelDelay, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglReleaseImageBufferEventsI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="pAddress">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="count">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static Boolean ReleaseImageBufferEventsI3D(IntPtr hDC, IntPtr[] pAddress, UInt32 count) {
			Boolean retvalue;
			unsafe {
				fixed (IntPtr* fp_pAddress = pAddress)
				{
					if      (Delegates.pwglReleaseImageBufferEventsI3D != null)
						retvalue = (Delegates.pwglReleaseImageBufferEventsI3D(hDC, fp_pAddress, count));
					else
						throw new InvalidOperationException("binding point ReleaseImageBufferEventsI3D cannot be found");
				}
			}
			LogProc("wglReleaseImageBufferEventsI3D({0}, {1}, {2}) = {3}", hDC, pAddress, count, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglSetDigitalVideoParametersI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iAttribute">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="piValue">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		public static Boolean SetDigitalVideoParametersI3D(IntPtr hDC, int iAttribute, int[] piValue) {
			Boolean retvalue;
			unsafe {
				fixed (int* fp_piValue = piValue)
				{
					if      (Delegates.pwglSetDigitalVideoParametersI3D != null)
						retvalue = (Delegates.pwglSetDigitalVideoParametersI3D(hDC, iAttribute, fp_piValue));
					else
						throw new InvalidOperationException("binding point SetDigitalVideoParametersI3D cannot be found");
				}
			}
			LogProc("wglSetDigitalVideoParametersI3D({0}, {1}, {2}) = {3}", hDC, iAttribute, piValue, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglSetGammaTableI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iEntries">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="puRed">
		/// A <see cref="T:System.UInt16*"/>.
		/// </param>
		/// <param name="puGreen">
		/// A <see cref="T:System.UInt16*"/>.
		/// </param>
		/// <param name="puBlue">
		/// A <see cref="T:System.UInt16*"/>.
		/// </param>
		public static Boolean SetGammaTableI3D(IntPtr hDC, int iEntries, UInt16[] puRed, UInt16[] puGreen, UInt16[] puBlue) {
			Boolean retvalue;
			unsafe {
				fixed (UInt16* fp_puRed = puRed)
				fixed (UInt16* fp_puGreen = puGreen)
				fixed (UInt16* fp_puBlue = puBlue)
				{
					if      (Delegates.pwglSetGammaTableI3D != null)
						retvalue = (Delegates.pwglSetGammaTableI3D(hDC, iEntries, fp_puRed, fp_puGreen, fp_puBlue));
					else
						throw new InvalidOperationException("binding point SetGammaTableI3D cannot be found");
				}
			}
			LogProc("wglSetGammaTableI3D({0}, {1}, {2}, {3}, {4}) = {5}", hDC, iEntries, puRed, puGreen, puBlue, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglSetGammaTableParametersI3D function.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="iAttribute">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="piValue">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		public static Boolean SetGammaTableParametersI3D(IntPtr hDC, int iAttribute, int[] piValue) {
			Boolean retvalue;
			unsafe {
				fixed (int* fp_piValue = piValue)
				{
					if      (Delegates.pwglSetGammaTableParametersI3D != null)
						retvalue = (Delegates.pwglSetGammaTableParametersI3D(hDC, iAttribute, fp_piValue));
					else
						throw new InvalidOperationException("binding point SetGammaTableParametersI3D cannot be found");
				}
			}
			LogProc("wglSetGammaTableParametersI3D({0}, {1}, {2}) = {3}", hDC, iAttribute, piValue, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglSwapBuffersMscOML function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="target_msc">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="divisor">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="remainder">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		public static Int64 SwapBuffersMscOML(IntPtr hdc, Int64 target_msc, Int64 divisor, Int64 remainder) {
			Int64 retvalue;
			if      (Delegates.pwglSwapBuffersMscOML != null)
				retvalue = (Delegates.pwglSwapBuffersMscOML(hdc, target_msc, divisor, remainder));
			else
				throw new InvalidOperationException("binding point SwapBuffersMscOML cannot be found");
			LogProc("wglSwapBuffersMscOML({0}, {1}, {2}, {3}) = {4}", hdc, target_msc, divisor, remainder, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglSwapLayerBuffersMscOML function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="fuPlanes">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="target_msc">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="divisor">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="remainder">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		public static Int64 SwapLayerBuffersMscOML(IntPtr hdc, int fuPlanes, Int64 target_msc, Int64 divisor, Int64 remainder) {
			Int64 retvalue;
			if      (Delegates.pwglSwapLayerBuffersMscOML != null)
				retvalue = (Delegates.pwglSwapLayerBuffersMscOML(hdc, fuPlanes, target_msc, divisor, remainder));
			else
				throw new InvalidOperationException("binding point SwapLayerBuffersMscOML cannot be found");
			LogProc("wglSwapLayerBuffersMscOML({0}, {1}, {2}, {3}, {4}) = {5}", hdc, fuPlanes, target_msc, divisor, remainder, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglWaitForMscOML function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="target_msc">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="divisor">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="remainder">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="ust">
		/// A <see cref="T:System.Int64"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="msc">
		/// A <see cref="T:System.Int64"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="sbc">
		/// A <see cref="T:System.Int64"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean WaitForMscOML(IntPtr hdc, Int64 target_msc, Int64 divisor, Int64 remainder, [Out] out Int64 ust, [Out] out Int64 msc, [Out] out Int64 sbc) {
			Boolean retvalue;
			unsafe {
				fixed (Int64* fp_ust = &ust)
				fixed (Int64* fp_msc = &msc)
				fixed (Int64* fp_sbc = &sbc)
				{
					if      (Delegates.pwglWaitForMscOML != null)
						retvalue = (Delegates.pwglWaitForMscOML(hdc, target_msc, divisor, remainder, fp_ust, fp_msc, fp_sbc));
					else
						throw new InvalidOperationException("binding point WaitForMscOML cannot be found");
				}
			}
			LogProc("wglWaitForMscOML({0}, {1}, {2}, {3}, {4}, {5}, {6}) = {7}", hdc, target_msc, divisor, remainder, ust, msc, sbc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for wglWaitForSbcOML function.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="target_sbc">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="ust">
		/// A <see cref="T:System.Int64"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="msc">
		/// A <see cref="T:System.Int64"/>.
		/// This parameter holds data returned from function.
		/// </param>
		/// <param name="sbc">
		/// A <see cref="T:System.Int64"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static Boolean WaitForSbcOML(IntPtr hdc, Int64 target_sbc, [Out] out Int64 ust, [Out] out Int64 msc, [Out] out Int64 sbc) {
			Boolean retvalue;
			unsafe {
				fixed (Int64* fp_ust = &ust)
				fixed (Int64* fp_msc = &msc)
				fixed (Int64* fp_sbc = &sbc)
				{
					if      (Delegates.pwglWaitForSbcOML != null)
						retvalue = (Delegates.pwglWaitForSbcOML(hdc, target_sbc, fp_ust, fp_msc, fp_sbc));
					else
						throw new InvalidOperationException("binding point WaitForSbcOML cannot be found");
				}
			}
			LogProc("wglWaitForSbcOML({0}, {1}, {2}, {3}, {4}) = {5}", hdc, target_sbc, ust, msc, sbc, retvalue);
			return (retvalue);
		}

		internal static partial class Delegates
		{
			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglAssociateImageBufferEventsI3D(IntPtr hDC, IntPtr* pEvent, IntPtr* pAddress, Int32* pSize, UInt32 count);
			internal static wglAssociateImageBufferEventsI3D pwglAssociateImageBufferEventsI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglBeginFrameTrackingI3D();
			internal static wglBeginFrameTrackingI3D pwglBeginFrameTrackingI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate IntPtr wglCreateImageBufferI3D(IntPtr hDC, Int32 dwSize, UInt32 uFlags);
			internal static wglCreateImageBufferI3D pwglCreateImageBufferI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglDestroyImageBufferI3D(IntPtr hDC, IntPtr pAddress);
			internal static wglDestroyImageBufferI3D pwglDestroyImageBufferI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglDisableFrameLockI3D();
			internal static wglDisableFrameLockI3D pwglDisableFrameLockI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglDisableGenlockI3D(IntPtr hDC);
			internal static wglDisableGenlockI3D pwglDisableGenlockI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglEnableFrameLockI3D();
			internal static wglEnableFrameLockI3D pwglEnableFrameLockI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglEnableGenlockI3D(IntPtr hDC);
			internal static wglEnableGenlockI3D pwglEnableGenlockI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglEndFrameTrackingI3D();
			internal static wglEndFrameTrackingI3D pwglEndFrameTrackingI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglGenlockSampleRateI3D(IntPtr hDC, UInt32 uRate);
			internal static wglGenlockSampleRateI3D pwglGenlockSampleRateI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglGenlockSourceDelayI3D(IntPtr hDC, UInt32 uDelay);
			internal static wglGenlockSourceDelayI3D pwglGenlockSourceDelayI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglGenlockSourceEdgeI3D(IntPtr hDC, UInt32 uEdge);
			internal static wglGenlockSourceEdgeI3D pwglGenlockSourceEdgeI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Boolean wglGenlockSourceI3D(IntPtr hDC, UInt32 uSource);
			internal static wglGenlockSourceI3D pwglGenlockSourceI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetDigitalVideoParametersI3D(IntPtr hDC, int iAttribute, [Out] int* piValue);
			internal static wglGetDigitalVideoParametersI3D pwglGetDigitalVideoParametersI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetFrameUsageI3D([Out] float* pUsage);
			internal static wglGetFrameUsageI3D pwglGetFrameUsageI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetGammaTableI3D(IntPtr hDC, int iEntries, [Out] UInt16* puRed, [Out] UInt16* puGreen, [Out] UInt16* puBlue);
			internal static wglGetGammaTableI3D pwglGetGammaTableI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetGammaTableParametersI3D(IntPtr hDC, int iAttribute, [Out] int* piValue);
			internal static wglGetGammaTableParametersI3D pwglGetGammaTableParametersI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetGenlockSampleRateI3D(IntPtr hDC, [Out] UInt32* uRate);
			internal static wglGetGenlockSampleRateI3D pwglGetGenlockSampleRateI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetGenlockSourceDelayI3D(IntPtr hDC, [Out] UInt32* uDelay);
			internal static wglGetGenlockSourceDelayI3D pwglGetGenlockSourceDelayI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetGenlockSourceEdgeI3D(IntPtr hDC, [Out] UInt32* uEdge);
			internal static wglGetGenlockSourceEdgeI3D pwglGetGenlockSourceEdgeI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetGenlockSourceI3D(IntPtr hDC, [Out] UInt32* uSource);
			internal static wglGetGenlockSourceI3D pwglGetGenlockSourceI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetMscRateOML(IntPtr hdc, [Out] Int32* numerator, [Out] Int32* denominator);
			internal static wglGetMscRateOML pwglGetMscRateOML = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglGetSyncValuesOML(IntPtr hdc, [Out] Int64* ust, [Out] Int64* msc, [Out] Int64* sbc);
			internal static wglGetSyncValuesOML pwglGetSyncValuesOML = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglIsEnabledFrameLockI3D([Out] Boolean* pFlag);
			internal static wglIsEnabledFrameLockI3D pwglIsEnabledFrameLockI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglIsEnabledGenlockI3D(IntPtr hDC, [Out] Boolean* pFlag);
			internal static wglIsEnabledGenlockI3D pwglIsEnabledGenlockI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglQueryFrameLockMasterI3D([Out] Boolean* pFlag);
			internal static wglQueryFrameLockMasterI3D pwglQueryFrameLockMasterI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglQueryFrameTrackingI3D([Out] Int32* pFrameCount, [Out] Int32* pMissedFrames, [Out] float* pLastMissedUsage);
			internal static wglQueryFrameTrackingI3D pwglQueryFrameTrackingI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglQueryGenlockMaxSourceDelayI3D(IntPtr hDC, [Out] UInt32* uMaxLineDelay, [Out] UInt32* uMaxPixelDelay);
			internal static wglQueryGenlockMaxSourceDelayI3D pwglQueryGenlockMaxSourceDelayI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglReleaseImageBufferEventsI3D(IntPtr hDC, IntPtr* pAddress, UInt32 count);
			internal static wglReleaseImageBufferEventsI3D pwglReleaseImageBufferEventsI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglSetDigitalVideoParametersI3D(IntPtr hDC, int iAttribute, int* piValue);
			internal static wglSetDigitalVideoParametersI3D pwglSetDigitalVideoParametersI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglSetGammaTableI3D(IntPtr hDC, int iEntries, UInt16* puRed, UInt16* puGreen, UInt16* puBlue);
			internal static wglSetGammaTableI3D pwglSetGammaTableI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglSetGammaTableParametersI3D(IntPtr hDC, int iAttribute, int* piValue);
			internal static wglSetGammaTableParametersI3D pwglSetGammaTableParametersI3D = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Int64 wglSwapBuffersMscOML(IntPtr hdc, Int64 target_msc, Int64 divisor, Int64 remainder);
			internal static wglSwapBuffersMscOML pwglSwapBuffersMscOML = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Int64 wglSwapLayerBuffersMscOML(IntPtr hdc, int fuPlanes, Int64 target_msc, Int64 divisor, Int64 remainder);
			internal static wglSwapLayerBuffersMscOML pwglSwapLayerBuffersMscOML = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglWaitForMscOML(IntPtr hdc, Int64 target_msc, Int64 divisor, Int64 remainder, [Out] Int64* ust, [Out] Int64* msc, [Out] Int64* sbc);
			internal static wglWaitForMscOML pwglWaitForMscOML = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Boolean wglWaitForSbcOML(IntPtr hdc, Int64 target_sbc, [Out] Int64* ust, [Out] Int64* msc, [Out] Int64* sbc);
			internal static wglWaitForSbcOML pwglWaitForSbcOML = null;

		}

		internal static partial class Imports
		{
			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglAssociateImageBufferEventsI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglAssociateImageBufferEventsI3D(IntPtr hDC, IntPtr* pEvent, IntPtr* pAddress, Int32* pSize, UInt32 count);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglBeginFrameTrackingI3D", ExactSpelling = true)]
			internal extern static Boolean wglBeginFrameTrackingI3D();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglCreateImageBufferI3D", ExactSpelling = true)]
			internal extern static IntPtr wglCreateImageBufferI3D(IntPtr hDC, Int32 dwSize, UInt32 uFlags);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglDestroyImageBufferI3D", ExactSpelling = true)]
			internal extern static Boolean wglDestroyImageBufferI3D(IntPtr hDC, IntPtr pAddress);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglDisableFrameLockI3D", ExactSpelling = true)]
			internal extern static Boolean wglDisableFrameLockI3D();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglDisableGenlockI3D", ExactSpelling = true)]
			internal extern static Boolean wglDisableGenlockI3D(IntPtr hDC);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglEnableFrameLockI3D", ExactSpelling = true)]
			internal extern static Boolean wglEnableFrameLockI3D();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglEnableGenlockI3D", ExactSpelling = true)]
			internal extern static Boolean wglEnableGenlockI3D(IntPtr hDC);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglEndFrameTrackingI3D", ExactSpelling = true)]
			internal extern static Boolean wglEndFrameTrackingI3D();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGenlockSampleRateI3D", ExactSpelling = true)]
			internal extern static Boolean wglGenlockSampleRateI3D(IntPtr hDC, UInt32 uRate);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGenlockSourceDelayI3D", ExactSpelling = true)]
			internal extern static Boolean wglGenlockSourceDelayI3D(IntPtr hDC, UInt32 uDelay);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGenlockSourceEdgeI3D", ExactSpelling = true)]
			internal extern static Boolean wglGenlockSourceEdgeI3D(IntPtr hDC, UInt32 uEdge);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGenlockSourceI3D", ExactSpelling = true)]
			internal extern static Boolean wglGenlockSourceI3D(IntPtr hDC, UInt32 uSource);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetDigitalVideoParametersI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetDigitalVideoParametersI3D(IntPtr hDC, int iAttribute, [Out]int* piValue);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetFrameUsageI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetFrameUsageI3D([Out]float pUsage);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetGammaTableI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetGammaTableI3D(IntPtr hDC, int iEntries, [Out]UInt16* puRed, [Out]UInt16* puGreen, [Out]UInt16* puBlue);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetGammaTableParametersI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetGammaTableParametersI3D(IntPtr hDC, int iAttribute, [Out]int* piValue);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetGenlockSampleRateI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetGenlockSampleRateI3D(IntPtr hDC, [Out]UInt32 uRate);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetGenlockSourceDelayI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetGenlockSourceDelayI3D(IntPtr hDC, [Out]UInt32 uDelay);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetGenlockSourceEdgeI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetGenlockSourceEdgeI3D(IntPtr hDC, [Out]UInt32 uEdge);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetGenlockSourceI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetGenlockSourceI3D(IntPtr hDC, [Out]UInt32 uSource);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetMscRateOML", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetMscRateOML(IntPtr hdc, [Out]Int32 numerator, [Out]Int32 denominator);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglGetSyncValuesOML", ExactSpelling = true)]
			internal extern static unsafe Boolean wglGetSyncValuesOML(IntPtr hdc, [Out]Int64 ust, [Out]Int64 msc, [Out]Int64 sbc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglIsEnabledFrameLockI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglIsEnabledFrameLockI3D([Out]Boolean pFlag);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglIsEnabledGenlockI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglIsEnabledGenlockI3D(IntPtr hDC, [Out]Boolean pFlag);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglQueryFrameLockMasterI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglQueryFrameLockMasterI3D([Out]Boolean pFlag);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglQueryFrameTrackingI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglQueryFrameTrackingI3D([Out]Int32 pFrameCount, [Out]Int32 pMissedFrames, [Out]float pLastMissedUsage);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglQueryGenlockMaxSourceDelayI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglQueryGenlockMaxSourceDelayI3D(IntPtr hDC, [Out]UInt32 uMaxLineDelay, [Out]UInt32 uMaxPixelDelay);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglReleaseImageBufferEventsI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglReleaseImageBufferEventsI3D(IntPtr hDC, IntPtr* pAddress, UInt32 count);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglSetDigitalVideoParametersI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglSetDigitalVideoParametersI3D(IntPtr hDC, int iAttribute, int* piValue);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglSetGammaTableI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglSetGammaTableI3D(IntPtr hDC, int iEntries, UInt16* puRed, UInt16* puGreen, UInt16* puBlue);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglSetGammaTableParametersI3D", ExactSpelling = true)]
			internal extern static unsafe Boolean wglSetGammaTableParametersI3D(IntPtr hDC, int iAttribute, int* piValue);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglSwapBuffersMscOML", ExactSpelling = true)]
			internal extern static Int64 wglSwapBuffersMscOML(IntPtr hdc, Int64 target_msc, Int64 divisor, Int64 remainder);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglSwapLayerBuffersMscOML", ExactSpelling = true)]
			internal extern static Int64 wglSwapLayerBuffersMscOML(IntPtr hdc, int fuPlanes, Int64 target_msc, Int64 divisor, Int64 remainder);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglWaitForMscOML", ExactSpelling = true)]
			internal extern static unsafe Boolean wglWaitForMscOML(IntPtr hdc, Int64 target_msc, Int64 divisor, Int64 remainder, [Out]Int64 ust, [Out]Int64 msc, [Out]Int64 sbc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "wglWaitForSbcOML", ExactSpelling = true)]
			internal extern static unsafe Boolean wglWaitForSbcOML(IntPtr hdc, Int64 target_sbc, [Out]Int64 ust, [Out]Int64 msc, [Out]Int64 sbc);

		}

	}
}
